Skip to main content

Copy

Creates a copy of the current table.

Syntax

expression.Copy();

expression - A variable that represents a ApiTable class.

Parameters

This method doesn't have any parameters.

Returns

ApiTable

Example

This example creates a copy of the table.

let doc = Api.GetDocument();
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(2, 2);
table.SetWidth("percent", 100);
table.SetStyle(tableStyle);
doc.Push(table);
let copyTable = table.Copy();
doc.Push(copyTable);